package com.hc.jian;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface JianMapper {


    @Update("update user1 set money=money+#{money}, transfer = transfer - #{money} where id =#{userId}")
    void incrementMoney(@Param("userId") int userId, @Param("money") double money);

    @Update("update user1 set transfer = transfer + #{money} where id = #{userId}")
    void commit(@Param("userId") int userId, @Param("money") double money);

    @Update("update user1 set transfer = transfer + #{money}, money=money - #{money} where id = #{userId}")
    void cancel(@Param("userId") int userId, @Param("money") double money);

}